<?php
declare (strict_types = 1);
namespace app\admin\controller;
use app\admin\BaseController;
use think\facade\Request;
use think\facade\View;
use app\admin\logic\OrderLogic;
class Order extends BaseController
{
    public function orderDetail()
    {
        return view();
    }

    public function orderList()
    {
        $where = OrderLogic::getWhere();

        $list=\app\admin\model\Order::getOrderList($where);

        View::assign('list',$list);
        return view();
    }

    public function orderDel()
    {
        $id=Request::get('id','');
        if (!empty($id)){
            $del=\app\admin\model\Order::destroy($id);
            if ($del){
                $this->success('删除成功',url('Order/orderList'));
            }else{
                $this->error('网络波动,删除失败');
            }
        }
    }
}